class ArrayWrapper {
    nums
    constructor(nums) {
        this.nums = nums
        return this.valueOf()
    }
}



ArrayWrapper.prototype.valueOf = function () {
    let sum = 0
    for (let item of this.nums) {
        sum += item
    }
    return sum
}

ArrayWrapper.prototype.toString = function () {
    return JSON.stringify(this.nums)
}